package com.cn.web.controller.EM.basic;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.EM.partRegt.BarkPar;
import com.cn.mapper.dao.db5.EM.basic.BaseRackDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Transactional
@RequestMapping("/BaseRack")
public class BaseRackController {
    private final BaseRackDao baseRackDao;

    @Autowired(required = false)
    public BaseRackController(BaseRackDao baseRackDao) {
        this.baseRackDao = baseRackDao;
    }


    @RequestMapping("/insert")
    @ResponseBody
    public BarkPar insert(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        return baseRackDao.insert(String.valueOf(jsonObject));
    }

    @RequestMapping("/getList")
    @ResponseBody
    public String getList(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String list = baseRackDao.getList(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxxxxxxx:" + list);
        return list;
    }



    @RequestMapping("/getInfo")
    @ResponseBody
    public String getInfo(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = baseRackDao.getInfo(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/stateUp")
    @ResponseBody
    public BarkPar stateUp(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        return baseRackDao.stateUp(String.valueOf(jsonObject));
    }
    @RequestMapping("/MaterialAreaList")
    @ResponseBody
    public String materialAreaList(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String list = baseRackDao.materialAreaList(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxxxxxxx:" + list);
        return list;
    }

}
